#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;

class solution
{
public:
	vector<string> luckyString(const string &s)
	{
		vector<string> fibA,fibB;
		if(s.empty())
			return fibA;			

		//计算不同字符数为1的开始下标和结束下标位置，以string形式存入fibA
		for(int i = 0 ; i < s.size() ; ++i)
		{
			fibA.push_back(to_string(i) + ","+ to_string(i));
			for(int j = i+1 ; j < s.size() ; ++j)
				if(s[i] == s[j])
					fibA.push_back(to_string(i) + ","+to_string(j));
				else
					break;
		}
		vector<int> fibonacci{1,2,3,5,8,13,21};
		// cout<<fibA.size()<<endl;
		// printV(fibA);
		fibB = fibA;
		// printV(fibA);
		//计算fibonacci
		vector<string> output;
		output.insert(output.end(),fibB.begin(),fibB.end());
		// printV(output);
		for(int i = 0 ; i < 6 ; ++i)
		{
			vector<string> temp(fibB);
			fibB = uniqueFib(addVector(fibA,fibB));
			// if(fibB.empty() && i == 0)
			// {
			// 	output.clear();
			// 	for(int k = 0 ; k < 7 && fibonacci[k] < s.size(); ++k)
			// 	{
			// 		string in;
			// 		in.insert(0,fibonacci[k],s[0]);
			// 		output.push_back(in);
			// 	}
			// 	cout<<"output"<<endl;
			// 	printV(output);
			// 	return output;
			// }
			// else 
			if(fibB.empty())
				break;
			output.insert(output.end(),fibB.begin(),fibB.end());
			fibA = temp;
		}
		sort(output.begin(),output.end());
		output = uniqueFib(output);
		output = trans2Substring(s,output);
		sort(output.begin(),output.end());
		output = uniqueFib(output);
		// cout<<"output"<<endl;
		// printV(output);
		return output;
	}

	vector<string> trans2Substring(const string &src,const vector<string> &v)
	{
		vector<string> trans;
		for(const string &s : v)
		{
			int bg = stoi(s);
			int ed = stoi(s.substr(s.find(',')+1));
			// cout<<"begin : "<<bg<<", end : "<<ed<<endl;
			trans.push_back(src.substr(bg,ed-bg+1));
		}
		return trans;
	}
	vector<string> uniqueFib(const vector<string> &v)
	{
		vector<string> unique;
		if(v.empty())
			return unique;
		unique.push_back(v[0]);
		string cur = v[0];
		for(int i = 1 ; i < v.size(); ++i)
		{
			if(cur != v[i])
			{
				cur = v[i];
				unique.push_back(v[i]);
			}
		}
		return unique;
	}

	bool contains(const vector<string> &v,const string &s)
	{
		for(const string &tar : v)
		{
			if(tar == s)
				return true;
		}
		return false;
	}
	vector<string> addVector(const vector<string> &fibA, const vector<string> &fibB)
	{
		vector<string> result;
		for(const string &sA : fibA)
			for(const string &sB :fibB)
				if(sA[2] + 1 == sB[0])
				{
					string s;
					s.append(&sA[0],1).append(",").append(&sB[2],1);
					if(!contains(fibA,s) && !contains(fibB,s))
						result.push_back(s);
				}
		for(const string &sB : fibB)
			for(const string &sA :fibA)
				if(sB[2] + 1 == sA[0])
				{
					string s;
					s.append(&sB[0],1).append(",").append(&sA[2],1);
					if(!contains(fibA,s) && !contains(fibB,s))
						result.push_back(s);
				}
		if(result.empty())
			return result;
		sort(result.begin(),result.end());
		// cout<<"add"<<endl;
		// printV(result);
		// cout<<"sort"<<endl;
		// printV(result);
		// printV(sorted);
		return result;
	}

    void printV(const vector<string> &v)
    {
    	if(!v.empty())
	    	for(string i : v)
	    		cout<<i<<endl;
    }
};

int main()
{
	solution s;
	string in;
	cin>>in;
	vector<string> result = s.luckyString(in);
	s.printV(result);
	return 0;
}